<template>
	<view>
		<!-- 正常商品 -->
		<!--<view class="normal-price-box" v-if="goodsInfo.defaultSpecValue">
			<view class="shopro-selector-rect">
				<text class="unit" v-if="goodsInfo.cateType != '3'">￥</text>
				<text class="price">{{ goodsInfo.defaultSpecValue.price || 0 }}</text>
				<text class="notice original-price"
					v-if="goodsInfo.cateType != '3'">￥{{goodsInfo.defaultSpecValue.otPrice|| 0}}</text>
				<text class="notice" v-else>积分</text>
				<view class="notice" style="float: right;">{{ goodsInfo.modeNameFee}}</view>
			</view>
			<view class="price-bottom-box">
				<view class="flex justify-start align-center shopro-selector-rect">
					<view class="">
						业主价：￥{{ goodsInfo.defaultSpecValue.ownerPrice || 0}}</view>
					<text class="line"></text>
					<view class="sold">
						会员价：￥{{ goodsInfo.defaultSpecValue.vipPrice || 0}}</view>
					<text class="line"></text>
					<view class="sold">已售：{{ goodsInfo.sales || 0}}件</view>
				</view>
				<view class="flex justify-start align-center margin-top-xs shopro-selector-rect">
					<view class="">
						抵扣物业费：￥{{ goodsInfo.defaultSpecValue.deduction || 0}}</view>
				</view>
			</view>
		</view>-->

		<!-- <view class="flex justify-between bg-white">
			<view>
				<view class="goods-title more-t">{{ goodsInfo.prodName }}</view>
				<view class="sub-title more-t">{{ goodsInfo.prodDesc }}</view>
			</view>
			<view class="align-center to-shop" @click="_toShop">
				店铺
			</view>
		</view> -->
		
		<view class="normal-price-box" v-if="goodsInfo.defaultSpecValue">
			<view class="shopro-selector-rect">
				<view class="info">
					<text class="unit" v-if="goodsInfo.cateType != '3'">优惠价￥</text>
					<text class="price">{{ goodsInfo.defaultSpecValue.price || 0 }}</text>
					<!-- <text class="original-price" v-if="goodsInfo.cateType != '3'">原价￥{{goodsInfo.defaultSpecValue.otPrice|| 0}}</text> -->
					<!-- <text class="notice" v-else>积分</text> -->
				</view>
				<view class="fee">{{ goodsInfo.modeNameFee}}</view>
			</view>
			<view class="price-bottom-box">
				<!-- <view class="deduction">抵扣物业费：￥{{ goodsInfo.defaultSpecValue.deduction || 0}}</view> -->
				<view class="diff">
					<!-- <view class="owner">
						<text class="label">业主价</text>
						<text class="value">￥{{ goodsInfo.defaultSpecValue.ownerPrice || 0}}</text>
					</view> -->
					<!-- <view class="member">
						<text class="label">会员价</text>
						<text class="value">￥{{ goodsInfo.defaultSpecValue.vipPrice || 0}}</text>
					</view> -->
					<view class="sold">已售：{{ goodsInfo.sales || 0}}件</view>
				</view>
			</view>
		</view>
		
	</view>
</template>

<script>
	var timer = null;
	export default {
		name: 'goodsPrice',
		components: {},
		data() {
			return {
				loading: false,
				time: {}, //倒计时
				activityRules: {
					startTime: 0,
					endTime: 0,
					status: '',
					countDownTime: 0
				}
			};
		},
		props: {
			goodsInfo: Object,
			type: ''
		},
		created() {},
		destroyed() {},
		computed: {},
		methods: {
			// 百分比
			_toShop: function() {
				//是否来自于HC的嵌套
				let _mallFrom = uni.getStorageSync(mapping.MALL_FROM)
				if (!_mallFrom) {
					uni.switchTab({
						url: '/pages/shopIndex/index?shopId=' + this.shopId
					})
					return;
				}
				this.vc.navigateTo({
					url: '/pages/cate/cate?shopId=' + this.shopId
				})
			}

		}
	};
</script>

<style lang="scss" scoped>
	// 正常商品
	.normal-price-box {
		color: #FFF;
		font-size: 24rpx;
		padding: 15rpx 30rpx 20rpx 30rpx;
		background: linear-gradient(#FD2C41, #F83438);
		background-size: 100% 100%;
		.shopro-selector-rect {
			display: flex;
			justify-content: space-between;
			align-items: baseline;
		}
		.info {
			display: flex;
			justify-content: space-between;
			align-items: baseline;
			.unit {
				margin-right: 5rpx;
			}
			.price {
				font-size: 42rpx;
			}
			.notice {
				margin-left: 10rpx;
			}
			.original-price {
				display: flex;
				align-items: center;
				&:before {
					content: '';
					display: block;
					height: 22rpx;
					opacity: 0.8;
					margin: 0 20rpx;
					border-left: 2rpx solid #FFF;
				}
			}
		}
		.price-bottom-box {
			.diff {
				display: flex;
				align-items: center;
				margin-top: 18rpx;
			}
			.deduction {
				margin-top: 10rpx;
			}
			.owner, .member {
				display: flex;
				align-items: center;
				font-size: 22rpx;
				margin-right: 15rpx;
				.label {
					display: flex;
					align-items: center;
					height: 32rpx;
					padding: 0 12rpx;
					border-radius: 6rpx 0 0 6rpx;
					background: #A8700D;
				}
				.value {
					display: flex;
					align-items: center;
					height: 32rpx;
					color: #A8700D;
					padding: 0 12rpx 0 6rpx;
					border-radius: 0 6rpx 6rpx 0;
					background: #FFF;
				}
			}
			.owner {
				.label {
					color: #FFF;
					background: #503E32;
				}
				.value {
					color: #503E32;
				}
			}
			.deduction {
				margin-top: 15rpx;
			}
		}
	}

	// 团购商品
	.groupon-price-box {
		padding: 20rpx;
		background: url('http://shopro.7wpp.com/imgs/group_price_bg.png') no-repeat;
		background-size: 100% 100%;

		.unit,
		.notice {
			font-size: 24rpx;
			color: rgba(#fff, 0.9);
		}

		.notice {
			line-height: 40rpx;
			border: 1rpx solid rgba(255, 255, 255, 1);
			border-radius: 6rpx;
			padding: 0 10rpx;
		}

		.price {
			font-size: 36rpx;
			color: rgba(#fff, 0.9);
			font-weight: bold;
			margin: 0 10rpx;
		}

		.price-bottom-box {
			font-size: 24rpx;
			color: rgba(#fff, 0.9);
			font-weight: 500;
			padding-top: 10rpx;

			.line {
				margin: 0 20rpx;
				display: inline-block;
				width: 3rpx;
				height: 24rpx;
				background-color: #fff;
			}

			.count-down {
				font-size: 24rpx;
				color: rgba(#fff, 0.9);
			}
		}
	}

	// 积分商品价格卡片
	.score-price-card {
		padding: 20rpx;
		background: url('http://shopro.7wpp.com/imgs/detail/671e3bc4581f0b35791f382e4b5c2a8.png') no-repeat;
		background-size: 100% 100%;
		width: 750rpx;

		.notice {
			font-size: 24rpx;
			color: #fff;
		}

		.score-img {
			width: 36rpx;
			height: 36rpx;
		}

		.price {
			font-size: 36rpx;
			color: #fff;
			font-weight: bold;
			margin: 0 10rpx;
		}

		.price-bottom-box {
			font-size: 24rpx;
			color: #fff;
			font-weight: 500;
			padding-top: 10rpx;

			.original-price {
				text-decoration: line-through;
			}

			.line {
				margin: 0 20rpx;
				display: inline-block;
				width: 3rpx;
				height: 24rpx;
				background-color: #fff;
			}
		}
	}

	// 秒杀商品
	.seckill-bg {
		background: url() no-repeat;
		background-size: 100% 100%;
	}

	.seckilled-bg {
		background: url() no-repeat;
		background-size: 100% 100%;
	}

	.seckill-price-box {
		padding: 20rpx;

		// background-color: #C8091E;
		.unit,
		.notice,
		.count-down {
			font-size: 24rpx;
			color: rgba(#fff, 0.9);
		}

		.notice {
			line-height: 40rpx;
			border: 1rpx solid rgba(255, 255, 255, 1);
			border-radius: 6rpx;
			padding: 0 10rpx;
			margin-left: 10rpx;
		}

		.price {
			font-size: 36rpx;
			color: rgba(#fff, 0.9);
			font-weight: bold;
			margin: 0 10rpx;
		}

		.price-bottom-box {
			font-size: 24rpx;
			color: rgba(#fff, 0.9);
			font-weight: 500;
			padding-top: 10rpx;

			.original-price {
				text-decoration: line-through;
			}

			.express {
				.cu-progress {
					width: 100rpx;
					height: 10rpx;

					.progress-item--end {
						background: #7c7c7c;
					}

					.progress-item--noend {
						background: #fff;
					}
				}

				.seckill-progress {
					background: #a1071a;
				}

				.seckilled-progress {
					background: #fff;
				}

				.progress-text {
					color: rgba(#fff, 0.9);
					font-size: 24rpx;
					margin-left: 10rpx;
				}
			}

			.line {
				margin: 0 20rpx;
				display: inline-block;
				width: 3rpx;
				height: 24rpx;
				background-color: #fff;
			}
		}
	}

	.goods-title {
		font-size: 36rpx;
		font-weight: 600;
		line-height: 42rpx;
		background-color: #fff;
		padding-bottom: 10rpx;
		padding: 20rpx 20rpx;
	}

	.sub-title {
		padding: 0 20rpx;
		color: #f3603f;
		font-size: 24rpx;
		font-weight: 500;
		line-height: 42rpx;
		background-color: #fff;
		padding-bottom: 10rpx;
	}

	.to-shop {
		line-height: 42upx;
		padding: 20rpx 20rpx;
	}
</style>
